import "./index.less";
import { BasicForm, FormSchema, useForm } from "@/components/Form";
import { BasicColumn, BasicTable, useTable } from "@/components/Table";
import PatientInformation from "@/components/ViewComponents/PatientInformation";
import Toolbar from "@/components/ViewComponents/Toolbar";
import { UserOutlined } from "@ant-design/icons";
import { Avatar } from "antd";
import { useTranslation } from "react-i18next";

const index = () => {
	const { t } = useTranslation();
	const en_vi = "Hospitalization.inpatientRegistration";
	const beInHospitalSchemas: FormSchema[] = [
		{
			label: t(`${en_vi}.admissionDate`),
			field: "AdmissionTime", //入院日期
			component: "DatePicker"
		},
		{
			label: t(`${en_vi}.hour`),
			field: "Hour", //时间
			component: "DatePicker"
		},
		{
			label: t(`${en_vi}.receivedFrom`),
			field: "ReceivedFrom", //接收人
			component: "Input"
		},
		{
			label: t(`${en_vi}.referralSource`),
			field: "ReferralSource", //转诊来源
			component: "Input"
		},
		{
			label: t(`${en_vi}.referralSourceName`),
			field: "NameReferralSource", //转诊来源名称
			component: "Input"
		},
		{
			label: t(`${en_vi}.reasonForAdmission`),
			field: "Admission", //入院原因
			component: "Input"
		},
		{
			label: t(`${en_vi}.howManyTimes`),
			field: "Number", //第几次入院
			component: "InputNumber"
		},
		{
			label: t(`${en_vi}.department`),
			field: "Department", //科室
			component: "Select",
			componentProps: {}
		}
	];
	const dischargeSchemas: FormSchema[] = [
		{
			label: t(`${en_vi}.admissionNumber`),
			field: "AdmissionNumber", //入院编号
			component: "Input"
		},
		{
			label: t(`${en_vi}.subject`),
			field: "Subject", //支付类型
			component: "Select",
			componentProps: {}
		},
		{
			label: t(`${en_vi}.cardNumber`),
			field: "CardNumber", //卡号
			component: "Input"
		},
		{
			label: t(`${en_vi}.from`),
			field: "From", //从哪里来
			component: "Input"
		},
		{
			label: t(`${en_vi}.to`),
			field: "To", //到里去
			component: "Input"
		},
		{
			label: t(`${en_vi}.startDateOfBenefits`),
			field: "StartDate", //福利开始日期
			component: "DatePicker"
		},
		{
			label: t(`${en_vi}.durationYears`),
			field: "years", //是否已到5年期限
			component: "Select",
			componentProps: {}
		},
		{
			label: t(`${en_vi}.exemption`),
			field: "Exemption", //是否共付豁免
			component: "Select",
			componentProps: {}
		},
		{
			label: t(`${en_vi}.date`),
			field: "ExemptionDate", //豁免日期
			component: "DatePicker"
		},
		{
			label: t(`${en_vi}.time`),
			field: "ExemptionTime", //豁免时间
			component: "DatePicker"
		},
		{
			label: t(`${en_vi}.salary`),
			field: "Salary", //享受级别
			component: "Select",
			componentProps: {}
		},
		{
			label: t(`${en_vi}.dischargedFromHospital`),
			field: "Hospital", //是否出院
			component: "Select",
			componentProps: {}
		},
		{
			label: t(`${en_vi}.registrationForMedicalExam`),
			field: "MedicalExam", //出院诊断
			component: "Input"
		},
		{
			label: t(`${en_vi}.offNetwork`),
			field: "Network", //是否满足豁免条件
			component: "Select",
			componentProps: {}
		},
		{
			label: t(`${en_vi}.payment`),
			field: "Payment", //是否已支付
			component: "Select",
			componentProps: {}
		},
		{
			label: t(`${en_vi}.relative`),
			field: "Relative", //家属
			component: "Input"
		},
		{
			label: t(`${en_vi}.fullName`),
			field: "RelativeName", //家属姓名
			component: "Input"
		},
		{
			label: t(`${en_vi}.address`),
			field: "RelativeAddress", //家属地址
			component: "Input"
		},
		{
			label: t(`${en_vi}.phone`),
			field: "RelativePhone", //家属电话
			component: "Input"
		},
		{
			label: t(`${en_vi}.transferLocation`),
			field: "TransferLocation", //转院地址
			component: "Input"
		},
		{
			label: t(`${en_vi}.emergencyExaminationDepartment`),
			field: "Emergency", //急诊诊断
			component: "Input"
		},
		{
			label: t(`${en_vi}.accompanyingIllness`),
			field: "Accompanying", //伴随疾病
			component: "Input"
		},
		{
			label: t(`${en_vi}.doctorReceivingPatient`),
			field: "Doctor", //接诊医生
			component: "Input"
		},
		{
			label: t(`${en_vi}.archiveNumber`),
			field: "ArchiveNumber", //住院编号
			component: "Input"
		},
		{
			label: t(`${en_vi}.pulse`),
			field: "Pulse", //脉搏
			component: "Input"
		},
		{
			label: t(`${en_vi}.temperature`),
			field: "Temperature", //体温
			component: "Input"
		},
		{
			label: t(`${en_vi}.bloodPressure`),
			field: "BloodPressure", //体温
			component: "Input"
		},
		{
			label: t(`${en_vi}.respirationRate`),
			field: "RespirationRate", //呼吸频率
			component: "Input"
		},
		{
			label: t(`${en_vi}.height`),
			field: "Height", //身高
			component: "Input"
		},
		{
			label: t(`${en_vi}.weight`),
			field: "Weight", //体重
			component: "Input"
		},
		{
			label: t(`${en_vi}.BMI`),
			field: "BMI", //身体质量指数
			component: "Input"
		}
	];
	const [beInHospitalRegister] = useForm({
		schemas: beInHospitalSchemas,
		labelWidth: 120,
		baseColProps: {
			span: 12
		}
	});
	const [dischargeRegister] = useForm({
		schemas: dischargeSchemas,
		labelWidth: 120,
		baseColProps: {
			span: 8
		}
	});
	const columns: BasicColumn[] = [];
	const [register] = useTable({
		columns,
		useSearchForm: true,
		bordered: true
	});
	const handlerToolbarAction = (key: string) => {
		console.log(key);
	};
	return (
		<div className="page inpatientRegistration">
			<div className="page-icontent page-content">
				<div className="block">
					<PatientInformation />
				</div>
				<div className="marginTop7 flex inpatientRegistration_content">
					<div className="width49 block ">
						<div>
							<h1 className="block-label">Ⅱ、{t(`${en_vi}.admissionInformationRegistration`)}</h1>
							<BasicForm register={beInHospitalRegister}></BasicForm>
						</div>
						<div className="flex">
							<div className="Avatar">
								<Avatar shape="square" size={60} icon={<UserOutlined />} />
							</div>
							<BasicTable register={register}></BasicTable>
						</div>
					</div>
					<div className="width49 block ">
						<h2 className="block-label">Ⅲ、{t(`${en_vi}.dischargeInformationRegistration`)}</h2>
						<BasicForm register={dischargeRegister}></BasicForm>
					</div>
				</div>
			</div>
			<Toolbar action={handlerToolbarAction} btnList={["save"]} />
		</div>
	);
};
export default index;
